package com.vader.boot.beanFactory;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author Vader
 * @date 2022/3/23
 **/
@Component
@Slf4j
public class Component2 {

    @Resource
    private ApplicationEventPublisher applicationEventPublisher;

    public void uploadFile(){
        log.info("uploadFile_start");
        applicationEventPublisher.publishEvent(new UserAgentEvent(this));
        log.info("uploadFile_end");
    }
}
